package com.fll.fangyiuser.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fll.fangyicommon.entity.ResultOk;
import com.fll.fangyicommon.entity.user.User;

import java.util.Map;

/**
 * @author fll
 * @create 2023/2/24
 */
public interface LoginService extends IService<User> {

    /**
     * 注册
     * @param user
     * @return
     */
    int register(User user);

    /**
     * 验证手机号是否注册
     * @param phone
     * @return
     */
    Boolean verifyRegistered(String phone);


    /**
     * 登录注册合并
     * @param params
     * @return
     */
    ResultOk loginOrRegister(Map<String, String> params) throws JsonProcessingException;

    /**
     *  根据手机号查询用户
     * @param phone
     * @return
     */
    User getUserByPhone(String phone);

    /**
     * 重置密码
     * @param params
     * @return
     */
    ResultOk resetPasss(Map<String, String> params);

}
